home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2001 Haziran / CHIP Haziran2001.iso / prog / haziran / 19 / setup.exe / data.z / spkr_gui.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-04-11  |  4.1 KB  |  132 lines

  1. VERSION 5.00
  2. Begin VB.Form spkr_gui 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Speaker"
  5.    ClientHeight    =   1800
  6.    ClientLeft      =   4410
  7.    ClientTop       =   4485
  8.    ClientWidth     =   5250
  9.    Icon            =   "spkr_gui.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1800
  14.    ScaleWidth      =   5250
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.CommandButton Exit_Button 
  17.       Caption         =   "Exit"
  18.       Height          =   375
  19.       Left            =   3840
  20.       TabIndex        =   7
  21.       Top             =   1200
  22.       Width           =   1095
  23.    End
  24.    Begin VB.CommandButton About_Button 
  25.       Caption         =   "About"
  26.       Height          =   375
  27.       Left            =   2040
  28.       TabIndex        =   6
  29.       Top             =   1200
  30.       Width           =   1095
  31.    End
  32.    Begin VB.TextBox duration 
  33.       Height          =   285
  34.       Left            =   3840
  35.       TabIndex        =   5
  36.       Text            =   "1000"
  37.       Top             =   600
  38.       Width           =   1095
  39.    End
  40.    Begin VB.TextBox frequency 
  41.       Height          =   285
  42.       Left            =   3840
  43.       TabIndex        =   4
  44.       Text            =   "440"
  45.       Top             =   120
  46.       Width           =   1095
  47.    End
  48.    Begin VB.CommandButton Tone_Button 
  49.       Caption         =   "Play Tone"
  50.       Height          =   375
  51.       Left            =   240
  52.       TabIndex        =   1
  53.       Top             =   360
  54.       Width           =   1095
  55.    End
  56.    Begin VB.CommandButton ChimeButton 
  57.       Caption         =   "Play Chime"
  58.       Height          =   375
  59.       Left            =   240
  60.       TabIndex        =   0
  61.       Top             =   1200
  62.       Width           =   1095
  63.    End
  64.    Begin VB.Label Label2 
  65.       Caption         =   "Duration (milliseconds)"
  66.       Height          =   255
  67.       Left            =   1800
  68.       TabIndex        =   3
  69.       Top             =   600
  70.       Width           =   1815
  71.    End
  72.    Begin VB.Label Label1 
  73.       Caption         =   "Frequency (Hertz)"
  74.       Height          =   255
  75.       Left            =   1800
  76.       TabIndex        =   2
  77.       Top             =   120
  78.       Width           =   1575
  79.    End
  80.    Begin VB.Line Line1 
  81.       X1              =   0
  82.       X2              =   5280
  83.       Y1              =   960
  84.       Y2              =   960
  85.    End
  86. Attribute VB_Name = "spkr_gui"
  87. Attribute VB_GlobalNameSpace = False
  88. Attribute VB_Creatable = False
  89. Attribute VB_PredeclaredId = True
  90. Attribute VB_Exposed = False
  91. '////////////////////////////////////////////////////////////////
  92. '// File - spktGUI.frm - code
  93. '// This application plays a tone to the speaker, and is
  94. '// controlled via a graphical user interface
  95. '// The speaker is accessed directly on the motherboard, using
  96. '// WinDriver functions.
  97. '////////////////////////////////////////////////////////////////
  98. Dim hSPEAKER As SPEAKER_HANDLE
  99. ' show an about box
  100. Private Sub About_Button_Click()
  101.     MsgBox "Speaker Sample v1.0" & Chr$(13) & Chr$(13) & _
  102.     "This sample accesses the on-board speaker" & Chr$(13) _
  103.     & " through the WinDriver's Visual Basic interface." _
  104.     & Chr$(13) & Chr$(13) & "Copyright (c) 2001 Jungo" _
  105.            , vbOKOnly, "About the Speaker Sample "
  106. End Sub
  107. ' play a simple chime
  108. Private Sub ChimeButton_Click()
  109.     SPEAKER_Tone hSPEAKER, 440, 400
  110.     SPEAKER_Tone hSPEAKER, 329, 200
  111.     SPEAKER_Tone hSPEAKER, 1, 10
  112.     SPEAKER_Tone hSPEAKER, 329, 200
  113.     SPEAKER_Tone hSPEAKER, 369, 400
  114.     SPEAKER_Tone hSPEAKER, 329, 800
  115.     SPEAKER_Tone hSPEAKER, 415, 400
  116.     SPEAKER_Tone hSPEAKER, 440, 600
  117. End Sub
  118. Private Sub Exit_Button_Click()
  119.     SPEAKER_Close hSPEAKER
  120.     Unload spkr_gui
  121. End Sub
  122. ' initialze and open a handle to the speaker
  123. Private Sub Form_Load()
  124.     If (Not SPEAKER_Open(hSPEAKER)) Then
  125.         MsgBox SPEAKER_ErrorString, vbOKOnly, "ERROR"
  126.     End If
  127. End Sub
  128. ' play one tone
  129. Private Sub Tone_Button_Click()
  130.     SPEAKER_Tone hSPEAKER, spkr_gui.frequency.Text, spkr_gui.duration.Text
  131. End Sub
  132.